package com.wwj.aicodemother.AI;

import com.wwj.aicodemother.AI.model.HtmlCodeResult;
import com.wwj.aicodemother.AI.model.MultiFileCodeResult;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.TokenStream;
import dev.langchain4j.service.UserMessage;
import reactor.core.publisher.Flux;

public interface AiCodeGeneratorService {
    /**
     * 单Html生成代码
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "prompt/coden-html-system-prompt.txt")
    HtmlCodeResult generateHtmlCode(String userMessage);

    /**
     * 多文档生成代码
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "prompt/coden-multi-file-system-prompt.txt")
    MultiFileCodeResult generateMultiFileCode(String userMessage);

    /**
     * 单Html生成代码(流式)
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "prompt/coden-html-system-prompt.txt")
    Flux<String> generateHtmlCodeStream(String userMessage);

    /**
     * 多文档生成代码(流式)
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "prompt/coden-multi-file-system-prompt.txt")
    Flux<String> generateMultiFileCodeStream(String userMessage);

    /**
     * Vue项目生成(流式)
     * @param appId
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "prompt/coden-vue-project-system-prompt.txt")
    TokenStream generateVueProjectCodeStream(@MemoryId Long appId, @UserMessage String userMessage);
}
